System and method for adjusting a torque capacity of an engine using model predictive control

ABSTRACT

A system according to the principles of the present disclosure includes a desired capacity module, an anticipated torque request module, and an engine actuator module. The desired capacity module generates a desired torque capacity of an engine at a future time based on a present torque request and a maximum torque output of the engine. The anticipated torque request module generates an anticipated torque request based on the desired torque capacity. The engine actuator module controls an actuator of the engine at a present time based on the anticipated torque request.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is related to U.S. patent application Ser. No. ______(HDP Ref. No. 8540P-001406) filed on ______, Ser. No.______ (HDP Ref.No. 8540P-001410) filed on ______, Ser. No.______ (HDP Ref. No.8540P-001411) filed on ______, Ser. No. ______ (HDP Ref. No.8540P-001412) filed on ______, Ser. No.______ (HDP Ref. No.8540P-001413) filed on ______, Ser. No.______ (HDP Ref. No.8540P-001417) filed on ______, Ser. No.______ (HDP Ref. No.8540P-001418) filed on ______, Ser. No. ______ (HDP Ref. No.8540P-001426) filed on ______, Ser. No.______ (HDP Ref. No.8540P-001427) filed on ______, Ser. No.______ (HDP Ref. No.8540P-001428) filed on ______, Ser. No.______ (HDP Ref. No.8540P-001429) filed on ______, Ser. No. ______ (HDP Ref. No.8540P-001430) filed on ______, Ser. No.______ (HDP Ref. No.8540P-001431) filed on ______, and ______ (HDP Ref. No. 8540P-001432)filed on ______. The entire disclosures of the above applications areincorporated herein by reference.

FIELD

The present disclosure relates to internal combustion engines, and moreparticularly, to systems and methods for adjusting a torque capacity ofan engine using model predictive control.

BACKGROUND

The background description provided here is for the purpose of generallypresenting the context of the disclosure. Work of the presently namedinventors, to the extent it is described in this background section, aswell as aspects of the description that may not otherwise qualify asprior art at the time of filing, are neither expressly nor impliedlyadmitted as prior art against the present disclosure.

Internal combustion engines combust an air and fuel mixture withincylinders to drive pistons, which produces drive torque. Air flow intothe engine is regulated via a throttle. More specifically, the throttleadjusts throttle area, which increases or decreases air flow into theengine. As the throttle area increases, the air flow into the engineincreases. A fuel control system adjusts the rate that fuel is injectedto provide a desired air/fuel mixture to the cylinders and/or to achievea desired torque output. Increasing the amount of air and fuel providedto the cylinders increases the torque output of the engine.

In spark-ignition engines, spark initiates combustion of an air/fuelmixture provided to the cylinders. In compression-ignition engines,compression in the cylinders combusts the air/fuel mixture provided tothe cylinders. Spark timing and air flow may be the primary mechanismsfor adjusting the torque output of spark-ignition engines, while fuelflow may be the primary mechanism for adjusting the torque output ofcompression-ignition engines.

Engine control systems have been developed to control engine outputtorque to achieve a desired torque. Traditional engine control systems,however, do not control the engine output torque as accurately asdesired. Further, traditional engine control systems do not provide arapid response to control signals or coordinate engine torque controlamong various devices that affect the engine output torque.

SUMMARY

A system according to the principles of the present disclosure includesa desired capacity module, an anticipated torque request module, and anengine actuator module. The desired capacity module generates a desiredtorque capacity of an engine at a future time based on a present torquerequest and a maximum torque output of the engine. The anticipatedtorque request module generates an anticipated torque request based onthe desired torque capacity. The engine actuator module controls anactuator of the engine at a present time based on the anticipated torquerequest.

Further areas of applicability of the present disclosure will becomeapparent from the detailed description, the claims and the drawings. Thedetailed description and specific examples are intended for purposes ofillustration only and are not intended to limit the scope of thedisclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure will become more fully understood from thedetailed description and the accompanying drawings, wherein:

FIG. 1 is a functional block diagram of an example engine systemaccording to the present disclosure;

FIG. 2 is a functional block diagram of an example engine control systemaccording to the present disclosure;

FIGS. 3 and 4 are functional block diagrams of example air controlmodules according to the present disclosure;

FIG. 5 is a flowchart illustrating an example method of controlling anengine using model predictive control according to the presentdisclosure; and

FIGS. 6 and 7 are graphs illustrating example signals for controlling anengine using model predictive control according to the presentdisclosure.

In the drawings, reference numbers may be reused to identify similarand/or identical elements.

DETAILED DESCRIPTION

An engine control module (ECM) controls torque output of an engine. Morespecifically, the ECM determines target values for actuators of theengine based on a requested amount of torque and controls the actuatorsbased on the target values. For example, the ECM controls intake andexhaust camshaft phasing based on target intake and exhaust phaserangles, a throttle valve based on a target throttle opening, an exhaustgas recirculation (EGR) valve based on a target EGR opening, and awastegate of a turbocharger based on a target wastegate duty cycle.

The ECM could determine the target values individually using multiplesingle input single output (SISO) controllers, such as proportionalintegral derivative (PID) controllers. However, when multiple SISOcontrollers are used, the target values may be set to maintain systemstability at the expense of possible fuel consumption decreases.Additionally, calibration and design of the individual SISO controllersmay be costly and time consuming.

The ECM of the present disclosure generates the target values usingmodel predictive control (MPC). More specifically, the ECM identifiespossible sets of target values based on an engine torque request. TheECM determines predicted parameters for each of the possible sets basedon the possible sets' target values and a mathematical model of theengine. For example, the ECM determines a predicted engine output torqueand a predicted air per cylinder (APC) for each of the possible sets oftarget values. The ECM may also determine one or more other predictedparameters for each possible set of target values.

The ECM may determine, a cost associated with use of each of thepossible sets. The ECM determines the cost based on a first differencebetween the predicted engine output torque determined for that possibleset and the engine torque request. The cost determined for a possibleset increases as a magnitude of the first difference increases and viceversa.

The ECM may select the one of the possible sets having the lowest cost.In this manner, the ECM may select the one of the possible sets that ispredicted to most closely track the engine torque request. The ECM setsthe target values for controlling the engine actuators using the targetvalues of the selected possible set. In various implementations, insteadof or in addition to identifying possible sets of target values anddetermining the cost of each of the sets, the ECM may generate a surfacerepresenting the cost of possible sets of target values. The ECM maythen identify the possible set that has the lowest cost based on theslope of the cost surface.

The ECM adjusts the torque capacity of the engine by activating ordeactivating cylinders of the engine and/or adjusting the amount bywhich intake and exhaust valves of the engine are lifted. In oneexample, the ECM switches the torque capacity of the engine from fullcapacity to a reduced capacity by deactivating half of the cylinders ofthe engine. In another example, the ECM switches the torque capacity ofthe engine from full capacity to a reduced capacity by adjusting theamount by which the intake and exhaust valves are lifted from a firstamount to a second amount that is less than the first amount.

When the ECM adjusts the torque capacity of the engine, the relationshipbetween the torque output of the engine and the target values changes.For example, when the ECM switches operation of the engine from fullcapacity to the reduced capacity, the amount of airflow per cylinderrequired to achieve a given torque output may increase. Therefore, theECM may select the mathematical model from a plurality of models thateach corresponds to a certain torque capacity, and the ECM may determinethe predicted parameters based on the mathematical model selected. As aresult, the ECM may adjust the target values based on the torquecapacity of the engine. For example, when the ECM switches operation ofthe engine from full capacity to the reduced capacity, the ECM mayadjust the target intake and exhaust phaser angles to increase theamount of airflow per cylinder.

There may be a lag or delay between the time when the ECM adjusts thetorque capacity of the engine to a new capacity and the time when theactuators are adjusted to satisfy the engine torque request at the newcapacity. To reduce this delay, the ECM generates a desired torquecapacity of the engine at a future time, generates an anticipated torquetrajectory based on the desired torque capacity, and adjusts the targetvalues based on the anticipated torque trajectory. For example, when theECM switches operation of the engine from full capacity to the reducedcapacity, the ECM may adjust the anticipated torque trajectory toreflect an anticipated torque increase.

The ECM may adjust the actuators in a manner that satisfies both thecurrent engine torque request and the anticipated torque trajectory. Forexample, the ECM may adjust slow actuators such as the throttle valve inresponse to the anticipated torque trajectory, and adjust fast actuatorssuch as the intake and exhaust cam phasers to avoid overshooting thecurrent engine torque request. Then, when the torque capacity of theengine is actually adjusted, the ECM may adjust the fast actuators tosatisfy the current engine torque request with minimal delay.

To further reduce the torque response lag associated with adjusting thetorque capacity, the ECM may generate a model torque capacity and selectthe mathematical model used to determine the predicted parameters basedon the model torque capacity. The ECM may switch the model torquecapacity to a new capacity, and therefore start adjusting the targetvalues based on the new capacity, before the ECM actually switches thetorque capacity of the engine to the new capacity.

Referring now to FIG. 1, an engine system 100 includes an engine 102that combusts an air/fuel mixture to produce drive torque for a vehicle.The amount of drive torque produced by the engine 102 is based on adriver input from a driver input module 104. The engine 102 may be agasoline spark ignition internal combustion engine.

Air is drawn into an intake manifold 110 through a throttle valve 112.For example only, the throttle valve 112 may include a butterfly valvehaving a rotatable blade. An engine control module (ECM) 114 controls athrottle actuator module 116, which regulates opening of the throttlevalve 112 to control the amount of air drawn into the intake manifold110.

Air from the intake manifold 110 is drawn into cylinders of the engine102. While the engine 102 may include multiple cylinders, forillustration purposes a single representative cylinder 118 is shown. Forexample only, the engine 102 may include 2, 3, 4, 5, 6, 8, 10, and/or 12cylinders. The ECM 114 may instruct a cylinder actuator module 120 toselectively deactivate some of the cylinders, which may improve fueleconomy under certain engine operating conditions.

The engine 102 may operate using a four-stroke cycle. The four strokes,described below, may be referred to as the intake stroke, thecompression stroke, the combustion stroke, and the exhaust stroke.During each revolution of a crankshaft (not shown), two of the fourstrokes occur within the cylinder 118. Therefore, two crankshaftrevolutions are necessary for the cylinder 118 to experience all four ofthe strokes.

During the intake stroke, air from the intake manifold 110 is drawn intothe cylinder 118 through an intake valve 122. The ECM 114 controls afuel actuator module 124, which regulates fuel injection to achieve atarget air/fuel ratio. Fuel may be injected into the intake manifold 110at a central location or at multiple locations, such as near the intakevalve 122 of each of the cylinders. In various implementations (notshown), fuel may be injected directly into the cylinders or into mixingchambers associated with the cylinders. The fuel actuator module 124 mayhalt injection of fuel to cylinders that are deactivated.

The injected fuel mixes with air and creates an air/fuel mixture in thecylinder 118. During the compression stroke, a piston (not shown) withinthe cylinder 118 compresses the air/fuel mixture. A spark actuatormodule 126 energizes a spark plug 128 in the cylinder 118 based on asignal from the ECM 114, which ignites the air/fuel mixture. The timingof the spark may be specified relative to the time when the piston is atits topmost position, referred to as top dead center (TDC).

The spark actuator module 126 may be controlled by a timing signalspecifying how far before or after TDC to generate the spark. Becausepiston position is directly related to crankshaft rotation, operation ofthe spark actuator module 126 may be synchronized with crankshaft angle.Generating spark may be referred to as a firing event. The sparkactuator module 126 may have the ability to vary the timing of the sparkfor each firing event. The spark actuator module 126 may vary the sparktiming for a next firing event when the spark timing is changed betweena last firing event and the next firing event. The spark actuator module126 may halt provision of spark to deactivated cylinders.

During the combustion stroke, the combustion of the air/fuel mixturedrives the piston away from TDC, thereby driving the crankshaft. Thecombustion stroke may be defined as the time between the piston reachingTDC and the time at which the piston reaches bottom dead center (BDC).During the exhaust stroke, the piston begins moving away from BDC andexpels the byproducts of combustion through an exhaust valve 130. Thebyproducts of combustion are exhausted from the vehicle via an exhaustsystem 134.

The intake valve 122 may be controlled by an intake camshaft 140, whilethe exhaust valve 130 may be controlled by an exhaust camshaft 142. Invarious implementations, multiple intake camshafts (including the intakecamshaft 140) may control multiple intake valves (including the intakevalve 122) for the cylinder 118 and/or may control the intake valves(including the intake valve 122) of multiple banks of cylinders(including the cylinder 118). Similarly, multiple exhaust camshafts(including the exhaust camshaft 142) may control multiple exhaust valvesfor the cylinder 118 and/or may control exhaust valves (including theexhaust valve 130) for multiple banks of cylinders (including thecylinder 118). In various other implementations, the intake valve 122and/or the exhaust valve 130 may be controlled by devices other thancamshafts, such as camless valve actuators. The cylinder actuator module120 may deactivate the cylinder 118 by disabling opening of the intakevalve 122 and/or the exhaust valve 130.

The time when the intake valve 122 is opened may be varied with respectto piston TDC by an intake cam phaser 148. The time when the exhaustvalve 130 is opened may be varied with respect to piston TDC by anexhaust cam phaser 150. A phaser actuator module 158 may control theintake cam phaser 148 and the exhaust cam phaser 150 based on signalsfrom the ECM 114. When implemented, variable valve lift (not shown) mayalso be controlled by the phaser actuator module 158.

The engine system 100 may include a turbocharger that includes a hotturbine 160-1 that is powered by hot exhaust gases flowing through theexhaust system 134. The turbocharger also includes a cold air compressor160-2 that is driven by the turbine 160-1. The compressor 160-2compresses air leading into the throttle valve 112. In variousimplementations, a supercharger (not shown), driven by the crankshaft,may compress air from the throttle valve 112 and deliver the compressedair to the intake manifold 110.

A wastegate 162 may allow exhaust to bypass the turbine 160-1, therebyreducing the boost (the amount of intake air compression) provided bythe turbocharger. A boost actuator module 164 may control the boost ofthe turbocharger by controlling opening of the wastegate 162. In variousimplementations, two or more turbochargers may be implemented and may becontrolled by the boost actuator module 164.

An air cooler (not shown) may transfer heat from the compressed aircharge to a cooling medium, such as engine coolant or air. An air coolerthat cools the compressed air charge using engine coolant may bereferred to as an intercooler. An air cooler that cools the compressedair charge using air may be referred to as a charge air cooler. Thecompressed air charge may receive heat, for example, via compressionand/or from components of the exhaust system 134. Although shownseparated for purposes of illustration, the turbine 160-1 and thecompressor 160-2 may be attached to each other, placing intake air inclose proximity to hot exhaust.

The engine system 100 may include an exhaust gas recirculation (EGR)valve 170, which selectively redirects exhaust gas back to the intakemanifold 110. The EGR valve 170 may be located upstream of theturbocharger's turbine 160-1. The EGR valve 170 may be controlled by anEGR actuator module 172 based on signals from the ECM 114.

A position of the crankshaft may be measured using a crankshaft position(CKP) sensor 180. A rotational speed of the crankshaft (an engine speed)may be determined based on the crankshaft position. A temperature of theengine coolant may be measured using an engine coolant temperature (ECT)sensor 182. The ECT sensor 182 may be located within the engine 102 orat other locations where the coolant is circulated, such as a radiator(not shown).

A pressure within the intake manifold 110 may be measured using amanifold absolute pressure (MAP) sensor 184. In various implementations,engine vacuum, which is the difference between ambient air pressure andthe pressure within the intake manifold 110, may be measured. A massflow rate of air flowing into the intake manifold 110 may be measuredusing a mass air flow (MAF) sensor 186. In various implementations, theMAF sensor 186 may be located in a housing that also includes thethrottle valve 112.

The throttle actuator module 116 may monitor the position of thethrottle valve 112 using one or more throttle position sensors (TPS)190. An ambient temperature of air being drawn into the engine 102 maybe measured using an intake air temperature (IAT) sensor 192. The enginesystem 100 may also include one or more other sensors 193, such as anambient humidity sensor, a barometric pressure sensor, one or more knocksensors, a compressor outlet pressure sensor and/or a throttle inlet airpressure (TIAP) sensor, a wastegate position sensor, an EGR positionsensor, and/or one or more other suitable sensors. The TIAP sensor maymeasure the pressure downstream from the compressor 160-2 and upstreamfrom the throttle valve 112. The ECM 114 may use signals from thesensors to make control decisions for the engine system 100.

The ECM 114 may communicate with a transmission control module 194 tocoordinate shifting gears in a transmission (not shown). For example,the ECM 114 may reduce engine torque during a gear shift. The ECM 114may communicate with a hybrid control module 196 to coordinate operationof the engine 102 and an electric motor 198.

The electric motor 198 may also function as a generator, and may be usedto produce electrical energy for use by vehicle electrical systemsand/or for storage in a battery. In various implementations, variousfunctions of the ECM 114, the transmission control module 194, and thehybrid control module 196 may be integrated into one or more modules.

Each system that varies an engine parameter may be referred to as anengine actuator. For example, the throttle actuator module 116 mayadjust opening of the throttle valve 112 to achieve a target throttleopening area. The spark actuator module 126 controls the spark plugs toachieve a target spark timing relative to piston TDC. The fuel actuatormodule 124 controls the fuel injectors to achieve target fuelingparameters. The phaser actuator module 158 may control the intake andexhaust cam phasers 148 and 150 to achieve target intake and exhaust camphaser angles, respectively. The EGR actuator module 172 may control theEGR valve 170 to achieve a target EGR opening area. The boost actuatormodule 164 controls the wastegate 162 to achieve a target wastegateopening area. The capacity actuator module 120 controls cylinderdeactivation to achieve a target number of activated or deactivatedcylinders.

The ECM 114 generates the target values for the engine actuators tocause the engine 102 to generate a target engine output torque. The ECM114 generates the target values for the engine actuators using modelpredictive control, as discussed further below.

Referring now to FIG. 2, an example implementation of the ECM 114includes a driver torque module 202, an axle torque arbitration module204, and a propulsion torque arbitration module 206. The ECM 114 mayinclude a hybrid optimization module 208. The ECM 114 may also include areserves/loads module 220, a torque requesting module 224, an aircontrol module 228, a spark control module 232, a capacity controlmodule 236, and/or a fuel control module 240.

The driver torque module 202 may determine a driver torque request 254based on a driver input 255 from the driver input module 104. The driverinput 255 may be based on, for example, a position of an acceleratorpedal and/or a position of a brake pedal. The driver input 255 may alsobe based on a cruise control system, which may be an adaptive cruisecontrol system that varies vehicle speed to maintain a predeterminedfollowing distance. The driver torque module 202 may store one or moremappings of accelerator pedal position to target torque and maydetermine the driver torque request 254 based on a selected one of themappings.

An axle torque arbitration module 204 arbitrates between the drivertorque request 254 and other axle torque requests 256. Axle torque(torque at the wheels) may be produced by various sources including anengine and/or an electric motor. For example, the axle torque requests256 may include a torque reduction requested by a traction controlsystem when positive wheel slip is detected. Positive wheel slip occurswhen axle torque overcomes friction between the wheels and the roadsurface, and the wheels begin to slip against the road surface. The axletorque requests 256 may also include a torque increase request tocounteract negative wheel slip, where a tire of the vehicle slips in theother direction with respect to the road surface because the axle torqueis negative.

The axle torque requests 256 may also include brake management requestsand vehicle over-speed torque requests. Brake management requests mayreduce axle torque to ensure that the axle torque does not exceed theability of the brakes to hold the vehicle when the vehicle is stopped.Vehicle over-speed torque requests may reduce the axle torque to preventthe vehicle from exceeding a predetermined speed. The axle torquerequests 256 may also be generated by vehicle stability control systems.

The axle torque arbitration module 204 outputs a predicted torquerequest 257 and an immediate torque request 258 based on the results ofarbitrating between the received torque requests 254 and 256. Asdescribed below, the predicted and immediate torque requests 257 and 258from the axle torque arbitration module 204 may selectively be adjustedby other modules of the ECM 114 before being used to control the engineactuators.

In general terms, the immediate torque request 258 may be an amount ofcurrently desired axle torque, while the predicted torque request 257may be an amount of axle torque that may be needed on short notice. TheECM 114 controls the engine system 100 to produce an axle torque equalto the immediate torque request 258. However, different combinations oftarget values may result in the same axle torque. The ECM 114 maytherefore adjust the target values to enable a faster transition to thepredicted torque request 257, while still maintaining the axle torque atthe immediate torque request 258.

In various implementations, the predicted torque request 257 may be setbased on the driver torque request 254. The immediate torque request 258may be set to less than the predicted torque request 257 under somecircumstances, such as when the driver torque request 254 is causingwheel slip on an icy surface. In such a case, a traction control system(not shown) may request a reduction via the immediate torque request258, and the ECM 114 reduces the engine torque output to the immediatetorque request 258. However, the ECM 114 performs the reduction so theengine system 100 can quickly resume producing the predicted torquerequest 257 once the wheel slip stops.

In general terms, the difference between the immediate torque request258 and the (generally higher) predicted torque request 257 can bereferred to as a torque reserve. The torque reserve may represent theamount of additional torque (above the immediate torque request 258)that the engine system 100 can begin to produce with minimal delay. Fastengine actuators are used to increase or decrease current axle torquewith minimal delay. Fast engine actuators are defined in contrast withslow engine actuators.

In general terms, fast engine actuators can change the axle torque morequickly than slow engine actuators. Slow actuators may respond moreslowly to changes in their respective target values than fast actuatorsdo. For example, a slow actuator may include mechanical components thatrequire time to move from one position to another in response to achange in target value. A slow actuator may also be characterized by theamount of time it takes for the axle torque to begin to change once theslow actuator begins to implement the changed target value. Generally,this amount of time will be longer for slow actuators than for fastactuators. In addition, even after beginning to change, the axle torquemay take longer to fully respond to a change in a slow actuator.

For example only, the spark actuator module 126 may be a fast actuator.Spark-ignition engines may combust fuels including, for example,gasoline and ethanol, by applying a spark. By way of contrast, thethrottle actuator module 116 may be a slow actuator.

For example, as described above, the spark actuator module 126 can varythe spark timing for a next firing event when the spark timing ischanged between a last firing event and the next firing event. By way ofcontrast, changes in throttle opening take longer to affect engineoutput torque. The throttle actuator module 116 changes the throttleopening by adjusting the angle of the blade of the throttle valve 112.Therefore, when the target value for opening of the throttle valve 112is changed, there is a mechanical delay as the throttle valve 112 movesfrom its previous position to a new position in response to the change.In addition, air flow changes based on the throttle opening are subjectto air transport delays in the intake manifold 110. Further, increasedair flow in the intake manifold 110 is not realized as an increase inengine output torque until the cylinder 118 receives additional air inthe next intake stroke, compresses the additional air, and commences thecombustion stroke.

Using these actuators as an example, a torque reserve can be created bysetting the throttle opening to a value that would allow the engine 102to produce the predicted torque request 257. Meanwhile, the spark timingcan be set based on the immediate torque request 258, which is less thanthe predicted torque request 257. Although the throttle openinggenerates enough air flow for the engine 102 to produce the predictedtorque request 257, the spark timing is retarded (which reduces torque)based on the immediate torque request 258. The engine output torque willtherefore be equal to the immediate torque request 258.

When additional torque is needed, the spark timing can be set based onthe predicted torque request 257 or a torque between the predicted andimmediate torque requests 257 and 258. By the following firing event,the spark actuator module 126 may return the spark timing to an optimumvalue, which allows the engine 102 to produce full engine output torqueachievable with the air flow already present. The engine output torquemay therefore be quickly increased to the predicted torque request 257without experiencing delays from changing the throttle opening.

The axle torque arbitration module 204 may output the predicted torquerequest 257 and the immediate torque request 258 to a propulsion torquearbitration module 206. In various implementations, the axle torquearbitration module 204 may output the predicted and immediate torquerequests 257 and 258 to the hybrid optimization module 208.

The hybrid optimization module 208 may determine how much torque shouldbe produced by the engine 102 and how much torque should be produced bythe electric motor 198. The hybrid optimization module 208 then outputsmodified predicted and immediate torque requests 259 and 260,respectively, to the propulsion torque arbitration module 206. Invarious implementations, the hybrid optimization module 208 may beimplemented in the hybrid control module 196.

The predicted and immediate torque requests received by the propulsiontorque arbitration module 206 are converted from an axle torque domain(torque at the wheels) into a propulsion torque domain (torque at thecrankshaft). This conversion may occur before, after, as part of, or inplace of the hybrid optimization module 208.

The propulsion torque arbitration module 206 arbitrates betweenpropulsion torque requests 290, including the converted predicted andimmediate torque requests. The propulsion torque arbitration module 206generates an arbitrated predicted torque request 261 and an arbitratedimmediate torque request 262. The arbitrated torque requests 261 and 262may be generated by selecting a winning request from among receivedtorque requests. Alternatively or additionally, the arbitrated torquerequests may be generated by modifying one of the received requestsbased on another one or more of the received torque requests.

For example, the propulsion torque requests 290 may include torquereductions for engine over-speed protection, torque increases for stallprevention, and torque reductions requested by the transmission controlmodule 194 to accommodate gear shifts. The propulsion torque requests290 may also result from clutch fuel cutoff, which reduces the engineoutput torque when the driver depresses the clutch pedal in a manualtransmission vehicle to prevent a flare in engine speed.

The propulsion torque requests 290 may also include an engine shutoffrequest, which may be initiated when a critical fault is detected. Forexample only, critical faults may include detection of vehicle theft, astuck starter motor, electronic throttle control problems, andunexpected torque increases. In various implementations, when an engineshutoff request is present, arbitration selects the engine shutoffrequest as the winning request. When the engine shutoff request ispresent, the propulsion torque arbitration module 206 may output zero asthe arbitrated predicted and immediate torque requests 261 and 262.

In various implementations, an engine shutoff request may simply shutdown the engine 102 separately from the arbitration process. Thepropulsion torque arbitration module 206 may still receive the engineshutoff request so that, for example, appropriate data can be fed backto other torque requestors. For example, all other torque requestors maybe informed that they have lost arbitration.

The reserves/loads module 220 receives the arbitrated predicted andimmediate torque requests 261 and 262. The reserves/loads module 220 mayadjust the arbitrated predicted and immediate torque requests 261 and262 to create a torque reserve and/or to compensate for one or moreloads. The reserves/loads module 220 then outputs adjusted predicted andimmediate torque requests 263 and 264 to the torque requesting module224.

For example only, a catalyst light-off process or a cold start emissionsreduction process may require retarded spark timing. The reserves/loadsmodule 220 may therefore increase the adjusted predicted torque request263 above the adjusted immediate torque request 264 to create retardedspark for the cold start emissions reduction process. In anotherexample, the air/fuel ratio of the engine and/or the mass air flow maybe directly varied, such as by diagnostic intrusive equivalence ratiotesting and/or new engine purging. Before beginning these processes, atorque reserve may be created or increased to quickly offset decreasesin engine output torque that result from leaning the air/fuel mixtureduring these processes.

The reserves/loads module 220 may also create or increase a torquereserve in anticipation of a future load, such as power steering pumpoperation or engagement of an air conditioning (A/C) compressor clutch.The reserve for engagement of the A/C compressor clutch may be createdwhen the driver first requests air conditioning. The reserves/loadsmodule 220 may increase the adjusted predicted torque request 263 whileleaving the adjusted immediate torque request 264 unchanged to producethe torque reserve. Then, when the A/C compressor clutch engages, thereserves/loads module 220 may increase the adjusted immediate torquerequest 264 by the estimated load of the A/C compressor clutch.

The torque requesting module 224 receives the adjusted predicted andimmediate torque requests 263 and 264. The torque requesting module 224determines how the adjusted predicted and immediate torque requests 263and 264 will be achieved. The torque requesting module 224 may be enginetype specific. For example, the torque requesting module 224 may beimplemented differently or use different control schemes forspark-ignition engines versus compression-ignition engines.

In various implementations, the torque requesting module 224 may definea boundary between modules that are common across all engine types andmodules that are engine type specific. For example, engine types mayinclude spark-ignition and compression-ignition. Modules prior to thetorque requesting module 224, such as the propulsion torque arbitrationmodule 206, may be common across engine types, while the torquerequesting module 224 and subsequent modules may be engine typespecific.

The torque requesting module 224 determines an air torque request 265based on the adjusted predicted and immediate torque requests 263 and264. The air torque request 265 may be a brake torque. Brake torque mayrefer to torque at the crankshaft under the current operatingconditions.

Target values for airflow controlling engine actuators are determinedbased on the air torque request 265. More specifically, based on the airtorque request 265, the air control module 228 determines a targetwastegate opening area 266, a target throttle opening area 267, a targetEGR opening area 268, a target intake cam phaser angle 269, and a targetexhaust cam phaser angle 270. The air control module 228 determines thetarget wastegate opening area 266, the target throttle opening area 267,the target EGR opening area 268, the target intake cam phaser angle 269,and the target exhaust cam phaser angle 270 using model predictivecontrol, as discussed further below.

The boost actuator module 164 controls the wastegate 162 to achieve thetarget wastegate opening area 266. For example, a first conversionmodule 272 may convert the target wastegate opening area 266 into atarget duty cycle 274 to be applied to the wastegate 162, and the boostactuator module 164 may apply a signal to the wastegate 162 based on thetarget duty cycle 274. In various implementations, the first conversionmodule 272 may convert the target wastegate opening area 266 into atarget wastegate position (not shown), and convert the target wastegateposition into the target duty cycle 274.

The throttle actuator module 116 controls the throttle valve 112 toachieve the target throttle opening area 267. For example, a secondconversion module 276 may convert the target throttle opening area 267into a target duty cycle 278 to be applied to the throttle valve 112,and the throttle actuator module 116 may apply a signal to the throttlevalve 112 based on the target duty cycle 278. In variousimplementations, the second conversion module 276 may convert the targetthrottle opening area 267 into a target throttle position (not shown),and convert the target throttle position into the target duty cycle 278.

The EGR actuator module 172 controls the EGR valve 170 to achieve thetarget EGR opening area 268. For example, a third conversion module 280may convert the target EGR opening area 268 into a target duty cycle 282to be applied to the EGR valve 170, and the EGR actuator module 172 mayapply a signal to the EGR valve 170 based on the target duty cycle 282.In various implementations, the third conversion module 280 may convertthe target EGR opening area 268 into a target EGR position (not shown),and convert the target EGR position into the target duty cycle 282.

The phaser actuator module 158 controls the intake cam phaser 148 toachieve the target intake cam phaser angle 269. The phaser actuatormodule 158 also controls the exhaust cam phaser 150 to achieve thetarget exhaust cam phaser angle 270. In various implementations, afourth conversion module (not shown) may be included and may convert thetarget intake and exhaust cam phaser angles into target intake andexhaust duty cycles, respectively. The phaser actuator module 158 mayapply the target intake and exhaust duty cycles to the intake andexhaust cam phasers 148 and 150, respectively. In variousimplementations, the air control module 228 may determine a targetoverlap factor and a target effective displacement, and the phaseractuator module 158 may control the intake and exhaust cam phasers 148and 150 to achieve the target overlap factor and the target effectivedisplacement.

The torque requesting module 224 may also generate a spark torquerequest 283, a torque capacity request 284, and a fuel torque request285 based on the predicted and immediate torque requests 263 and 264.The spark control module 232 may determine how much to retard the sparktiming (which reduces engine output torque) from an optimum spark timingbased on the spark torque request 283. For example only, a torquerelationship may be inverted to solve for a target spark timing 286. Fora given torque request (T_(Req)), the target spark timing (S_(T)) 286may be determined based on:

S _(T) =f ⁻¹(T _(Req),APC,I,E,AF,OT,#),  (1)

where APC is air per cylinder, I is an intake valve phasing value, E isan exhaust valve phasing value, AF is an air/fuel ratio, OT is an oiltemperature, and # is a number of activated cylinders. This relationshipmay be embodied as an equation and/or as a lookup table. The air/fuelratio (AF) may be the actual air/fuel ratio, as reported by the fuelcontrol module 240.

When the spark timing is set to the optimum spark timing, the resultingtorque may be as close to a maximum best torque (MBT) as possible. MBTrefers to the maximum engine output torque that is generated for a givenair flow as spark timing is advanced, while using fuel having an octanerating greater than a predetermined octane rating and usingstoichiometric fueling. The spark timing at which this maximum torqueoccurs is referred to as an MBT spark timing. The optimum spark timingmay differ slightly from MBT spark timing because of, for example, fuelquality (such as when lower octane fuel is used) and environmentalfactors, such as ambient humidity and temperature. The engine outputtorque at the optimum spark timing may therefore be less than MBT. Forexample only, a table of optimum spark timings corresponding todifferent engine operating conditions may be determined during acalibration phase of vehicle design, and the optimum value is determinedfrom the table based on current engine operating conditions.

The capacity control module 236 may determine a target torque capacity287 based on the torque capacity request 284. In one example, the targettorque capacity 287 may indicate a target number of cylinders todeactivate. In various implementations, a target number of cylinders toactivate may be used. The capacity actuator module 120 may selectivelyactivate and deactivate the valves of cylinders based on the targetnumber. The capacity control module 236 may also instruct the fuelcontrol module 240 to stop providing fuel for deactivated cylinders andmay instruct the spark control module 232 to stop providing spark fordeactivated cylinders. The spark control module 232 may stop providingspark to a cylinder once an air/fuel mixture that is already present inthe cylinder has been combusted.

In another example, the target torque capacity 287 may indicate a targetvalve lift. The capacity actuator module 120 may adjust the lift of theintake valve 122 and/or the exhaust valve 130 based on the target valvelift. In various implementations, the capacity actuator module 120 may,based on the target valve lift, switch between lifting the intake andexhaust valves 122, 130 by a first amount and lifting the intake andexhaust valves 122, 130 by a second amount. The first and second amountsmay be predetermined, and the second amount may be less than the firstamount. The first amount and the second amount may be referred to ashigh lift and low lift, respectively.

The capacity control module 236 may switch the target torque capacity287 between full capacity and a reduced capacity. For example, if thetarget torque capacity 287 indicates the target number of cylinders toactivate, the capacity control module 236 may switch the target torquecapacity 287 between activating all cylinders of the engine 102 andactivating half of the cylinders. In another example, if the targettorque capacity 287 indicates the target valve lift, the capacitycontrol module 236 may switch the target torque capacity 287 betweenhigh lift and low lift. In various implementations, the capacity controlmodule 236 may adjust the target torque capacity 287 to various levelsof reduced capacity (e.g., various amounts of valve lift).

The fuel control module 240 may vary the amount of fuel provided to eachcylinder based on the fuel torque request 285. More specifically, thefuel control module 240 may generate target fueling parameters 288 basedon the fuel torque request 285. The target fueling parameters 288 mayinclude, for example, target mass of fuel, target injection startingtiming, and target number of fuel injections.

During normal operation, the fuel control module 240 may operate in anair lead mode in which the fuel control module 240 attempts to maintaina stoichiometric air/fuel ratio by controlling fueling based on airflow. For example, the fuel control module 240 may determine a targetfuel mass that will yield stoichiometric combustion when combined with apresent mass of air per cylinder (APC).

FIG. 3 is a functional block diagram of an example implementation of theair control module 228. Referring now to FIGS. 2 and 3, as discussedabove, the air torque request 265 may be a brake torque. A torqueconversion module 304 converts the air torque request 265 from braketorque into base torque. The torque request resulting from conversioninto base torque is referred to herein as a base air torque request 306.

Base torques may refer to torque at the crankshaft made during operationof the engine 102 on a dynamometer while the engine 102 is warm and notorque loads are imposed on the engine 102 by accessories, such as analternator and the A/C compressor. The torque conversion module 304 mayconvert the air torque request 265 into the base air torque request 306,for example, using a mapping or a function that relates brake torques tobase torques.

An anticipated torque request module 308 generates anticipated torquerequests for the N control loops. The anticipated torque requests may bereferred to collectively as an anticipated torque trajectory. Theanticipated torque request module 308 may determine the anticipatedtorque trajectory based on a desired torque capacity of the engine 102,as discussed in more detail below. The anticipated torque request module308 outputs base air torque requests 310, which include the base airtorque request 306 for the current control loop and the anticipatedtorque requests for the N control loops.

An MPC module 312 generates the target values 266-270 using a MPC (ModelPredictive Control) scheme. The MPC module 312 may be a single module ormay comprise multiple modules. For example, the MPC module 312 mayinclude a sequence determination module 316. The sequence determinationmodule 316 determines possible sequences of the target values 266-270that could be used together during N future control loops.

A prediction module 323 determines predicted responses of the engine 102to the possible sequences of the target values 266-270, respectively,based on a (mathematical) model 324 of the engine 102, exogenous inputs328, and feedback inputs 330. More specifically, based on a possiblesequence of the target values 266-270, the exogenous inputs 328, and thefeedback inputs 330, using the model 324, the prediction module 323generates a sequence of predicted torques of the engine 102 for the Ncontrol loops, a sequence of predicted APCs for the N control loops, asequence of predicted amounts of external dilution for the N controlloops, a sequence of predicted amounts of residual dilution for the Ncontrol loops, a sequence of predicted combustion phasing values for theN control loops, and a sequence of predicted combustion quality valuesfor the N control loops.

The model 324 may be, for example, a function or a mapping calibratedbased on characteristics of the engine 102. The relationship between theresponses of the engine 102, the target values 266-270, the exogenousinputs 328, and the feedback inputs 330 may be nonlinear over the entirerange of possible engine speeds and engine loads. However, the model 324may include a plurality of linear models that each correspond to anengine speed and load range. The prediction module 323 may select one ofthe models based on the current engine speed and load, and use theselected model to predict the responses of the engine 102. For example,a first model may be used in an engine speed range from 1000 revolutionsper minute (RPM) to 2000 RPM and an engine load range from 100Newton-meters (Nm) to 150 Nm. A second model may be used in an enginespeed range from 1000 RPM to 2000 RPM and an engine load range from 150Nm to 200 Nm. A third model may be used in an engine speed range from2000 RPM to 3000 RPM and an engine load range from 100 Nm to 150 Nm.

Dilution may refer to an amount of exhaust from a prior combustion eventtrapped within a cylinder for a combustion event. External dilution mayrefer to exhaust provided for a combustion event via the EGR valve 170.Residual dilution (also referred to as internal dilution) may refer toexhaust that remains in a cylinder and/or exhaust that is pushed backinto the cylinder following the exhaust stroke of a combustion cycle.

Combustion phasing may refer to a crankshaft position where apredetermined amount of fuel injected is combusted within a cylinderrelative to a predetermined crankshaft position for combustion of thepredetermined amount of injected fuel. For example, combustion phasingmay be expressed in terms of CA50 relative to a predetermined CA50. CA50may refer to a crankshaft angle (CA) where 50 percent of a mass ofinjected fuel has been combusted within a cylinder. The predeterminedCA50 may correspond to a CA50 where a maximum amount of work is producedfrom the fuel injected and may be approximately 8.5-approximately 10degrees after TDC (top dead center) in various implementations. Whilecombustion phasing will be discussed in terms of CA50 values, anothersuitable parameter indicative of combustion phasing may be used.Additionally, while combustion quality will be discussed as coefficientof variation (COV) of indicated mean effective pressure (IMEP) values,another suitable parameter indicative of combustion quality may be used.

The exogenous inputs 328 may include parameters that are not directlyaffected by the throttle valve 112, the EGR valve 170, the turbocharger,the intake cam phaser 148, and the exhaust cam phaser 150. For example,the exogenous inputs 328 may include engine speed, turbocharger inletair pressure, IAT, and/or one or more other parameters. The feedbackinputs 330 may include, for example, an estimated torque output of theengine 102, an exhaust pressure downstream of the turbine 160-1 of theturbocharger, the IAT, an APC of the engine 102, an estimated residualdilution, an estimated external dilution, and/or one or more othersuitable parameters. The feedback inputs 330 may be measured usingsensors (e.g., the IAT) and/or estimated based on one or more otherparameters.

Each of the possible sequences identified by the sequence determinationmodule 316 includes one sequence of N values for each of the targetvalues 266-270. In other words, each possible sequence includes asequence of N values for the target wastegate opening area 266, asequence of N values for the target throttle opening area 267, asequence of N values for the target EGR opening area 268, a sequence ofN values for the target intake cam phaser angle 269, and a sequence of Nvalues for the target exhaust cam phaser angle 270. Each of the N valuesare for a corresponding one of the N future control loops. N is aninteger greater than or equal to one.

A cost module 332 determines a cost value for each of the possiblesequences of the target values 266-270 based on the predicted parametersdetermined for a possible sequence. An example cost determination isdiscussed further below.

A selection module 344 selects one of the possible sequences of thetarget values 266-270 based on the costs of the possible sequences,respectively. For example, the selection module 344 may select the oneof the possible sequences having the lowest cost while satisfyingactuator constraints 348 and output constraints 352.

In various implementations, satisfaction of the actuator constraints 348and the output constraints 352 may be considered in the costdetermination. In other words, the cost module 332 may determine thecost values further based on the actuator constraints 348 and the outputconstraints 352. In various implementations, the cost module 332 maydetermine the cost values based on reference values 356 for each of thetarget values 266-270. As discussed further below, based on how the costvalues are determined, the selection module 344 will select the one ofthe possible sequences that best achieves the base air torque request306 while minimizing the APC, subject to the actuator constraints 348and the output constraints 352.

The selection module 344 may set the target values 266-270 to therespective first ones of the N values of the selected sequence. In otherwords, the selection module 344 may set the target wastegate openingarea 266 to the first one of the N values in the sequence of N valuesfor the target wastegate opening area 266, set the target throttleopening area 267 to the first one of the N values in the sequence of Nvalues for the target throttle opening area 267, set the target EGRopening area 268 to the first one of the N values in the sequence of Nvalues for the target EGR opening area 268, set the target intake camphaser angle 269 to the first one of the N values in the sequence of Nvalues for the target intake cam phaser angle 269, and set the targetexhaust cam phaser angle 270 to the first one of the N values in thesequence of N values for the target exhaust cam phaser angle 270.

During a next control loop, the MPC module 312 identifies possiblesequences, generates the predicted parameters for the possiblesequences, determines the cost of each of the possible sequences,selects of one of the possible sequences, and sets of the target values266-270 to the first set of the target values 266-270 in the selectedsequence. This process continues for each control loop.

An actuator constraint module 360 (see FIG. 2) sets one of the actuatorconstraints 348 for each of the target values 266-270. In other words,the actuator constraint module 360 sets an actuator constraint for thethrottle valve 112, an actuator constraint for the EGR valve 170, anactuator constraint for the wastegate 162, an actuator constraint forthe intake cam phaser 148, and an actuator constraint for the exhaustcam phaser 150.

The actuator constraints 348 for each one of the target values 266-270may include a maximum value for an associated target value and a minimumvalue for that target value. The actuator constraint module 360 maygenerally set the actuator constraints 348 to predetermined operationalranges for the associated actuators. More specifically, the actuatorconstraint module 360 may generally set the actuator constraints 348 topredetermined operational ranges for the throttle valve 112, the EGRvalve 170, the wastegate 162, the intake cam phaser 148, and the exhaustcam phaser 150, respectively.

However, the actuator constraint module 360 may selectively adjust oneor more of the actuator constraints 348 under some circumstances. Forexample, the actuator constraint module 360 may adjust the actuatorconstraints for a given actuator to narrow the operational range forthat engine actuator when a fault is diagnosed in that engine actuator.For another example only, the actuator constraint module 360 may adjustthe actuator constraints such that the target value for a given actuatorfollows a predetermined schedule over time or changes by a predeterminedamount, for example, for a fault diagnostic, such as a cam phaser faultdiagnostic, a throttle diagnostic, an EGR diagnostic, etc. For a targetvalue to follow a predetermined schedule over time or to change by apredetermined amount, the actuator constraint module 360 may set theminimum and maximum values to the same value. The minimum and maximumvalues being set to the same value may force the corresponding targetvalue to be set to the same value as the minimum and maximum values. Theactuator constraint module 360 may vary the same value to which theminimum and maximum values are set over time to cause the target valueto follow a predetermined schedule.

An output constraint module 362 (see FIG. 2) sets the output constraints352 for the predicted torque output of the engine 102, the predictedCA50, the predicted COV of IMEP, the predicted residual dilution, andthe predicted external dilution. The output constraints 352 for each oneof the predicted values may include a maximum value for an associatedpredicted parameter and a minimum value for that predicted parameter.For example, the output constraints 352 may include a minimum torque, amaximum torque, a minimum CA50 and a maximum CA50, a minimum COV of IMEPand a maximum COV of IMEP, a minimum residual dilution and a maximumresidual dilution, and a minimum external dilution and a maximumexternal dilution.

The output constraint module 362 may generally set the outputconstraints 352 to predetermined ranges for the associated predictedparameters, respectively. However, the output constraint module 362 mayvary one or more of the output constraints 352 under some circumstances.For example, the output constraint module 362 may retard the maximumCA50, such as when knock occurs within the engine 102. For anotherexample, the output constraint module 362 may increase the maximum COVof IMEP under low load conditions, such as during engine idling where ahigher COV of IMEP may be needed to achieve a given torque request.

A reference module 364 (see FIG. 2) generates the reference values 356for the target values 266-270. The reference values 356 include areference for each of the target values 266-270. In other words, thereference values 356 include a reference wastegate opening area, areference throttle opening area, a reference EGR opening area, areference intake cam phaser angle, and a reference exhaust cam phaserangle.

The reference module 364 may determine the reference values 356, forexample, based on the air torque request 265, the base air torquerequest 306, and/or one or more other suitable parameters. The referencevalues 356 provide references for setting the target values 266-270,respectively. The reference values 356 may be used to determine the costvalues for possible sequences. The reference values 356 may also be usedfor one or more other reasons, such as by the sequence determinationmodule 316 to determine possible sequences.

Instead of or in addition to generating sequences of possible targetvalues and determining the cost of each of the sequences, the MPC module312 may identify a sequence of possible target values having the lowestcost using convex optimization techniques. For example, the MPC module312 may determine the target values 266-270 using a quadraticprogramming (QP) solver, such as a Dantzig QP solver. In anotherexample, the MPC module 312 may generate a surface of cost values forthe possible sequences of the target values 266-270 and, based on theslope of the cost surface, identify a set of possible target valueshaving the lowest cost. The MPC module 312 may then test that set ofpossible target values to determine whether that set of possible targetvalues will satisfy the actuator constraints 348 and the outputconstraints 352. The MPC module 312 selects the set of possible targetvalues having the lowest cost while satisfying the actuator constraints348 and the output constraints 352.

The cost module 332 may determine the cost for the possible sequences ofthe target values 266-270 based on relationships between: the predictedtorque and the base air torque request 306; the predicted APC and zero;the possible target values and the respective actuator constraints 348;the other predicted parameters and the respective output constraints352; and the possible target values and the respective reference values356. The relationships may be weighted, for example, to control theeffect that each of the relationships has on the cost.

For example only, the cost module 332 may determine the cost for apossible sequence of the target values 266-270 based on the equation:

${{Cost} = {{\sum\limits_{i = 1}^{N}\; {{{wT}*\left( {{TP}_{i} - {BATR}_{i}} \right)}}^{2}} + {{{wTR}*\left( {\frac{{TP}_{i}}{{APC}_{i}} - K} \right)}}^{2}}},$

where Cost is the cost for the possible sequence of the target values266-270, TPi is the predicted torque of the engine 102 for an i-th oneof the N control loops, BATRi is the i-th one of the base air torquerequests 310 for the i-th one of the N control loops, and wT is aweighting value associated with the relationship between the predictedand reference engine torques. APCPi is a predicted APC for the i-th oneof the N control loops and wTR is a weighting value associated with therelationship between the ratio of the predicted torque to the predictedAPC and a constant K.

The cost module 332 may determine the cost for a possible sequence ofthe target values 266-270 based on the following more detailed equation:

${{Cost} = {{\sum\limits_{i = 1}^{N}\; {\rho\varepsilon}^{2}} + {{{wT}*\left( {{TP}_{i} - {BATR}_{i}} \right)}}^{2} + {{{wTR}*\left( {\frac{{TP}_{i}}{{APC}_{i}} - K} \right)}}^{2} + {{{wTV}*\left( {{PTTOi} - {TORef}} \right)}}^{2} + {{{wWG}*\left( {{PTWGOi} - {EGORef}} \right)}}^{2} + {{{wEGR}*\left( {{PTEGROi} - {EGRORef}} \right)}}^{2} + {{{wIP}*\left( {{PTICPi} - {ICPRef}} \right)}}^{2} + {{{wEP}*\left( {{PTECPi} - {ECPRef}} \right)}}^{2}}},$

subject to the actuator constraints 348 and the output constraints 352.Cost is the cost for the possible sequence of the target values 266-270,TPi is the predicted torque of the engine 102 for an i-th one of the Ncontrol loops, BATRi is the i-th one of the base air torque requests 310for the i-th one of the N control loops, and wT is a weighting valueassociated with the relationship between the predicted and referenceengine torques. APCPi is a predicted APC for the i-th one of the Ncontrol loops and wTR is a weighting value associated with therelationship between the ratio of the predicted torque to the predictedAPC and a constant K.

PTTOi is a possible target throttle opening for the i-th one of the Ncontrol loops, TORef is the reference throttle opening, and wTV is aweighting value associated with the relationship between the possibletarget throttle openings and the reference throttle opening. PTWGOi is apossible target wastegate opening for the i-th one of the N controlloops, WGORef is the reference wastegate opening, and wWG is a weightingvalue associated with the relationship between the possible targetwastegate openings and the reference wastegate opening.

PTEGROi is a possible target EGR opening for the i-th one of the Ncontrol loops, EGRRef is the reference EGR opening, and wEGR is aweighting value associated with the relationship between the possibletarget EGR openings and the reference EGR opening. PTICi is a possibletarget intake cam phaser angle for the i-th one of the N control loops,ICPRef is the reference intake cam phaser angle, and wIP is a weightingvalue associated with the relationship between the possible targetintake cam phaser angle and the reference intake cam phaser angle. PTECiis a possible target exhaust cam phaser angle for the i-th one of the Ncontrol loops, ECPRef is the reference exhaust cam phaser angle, and wEPis a weighting value associated with the relationship between thepossible target exhaust cam phaser angle and the reference exhaust camphaser angle.

ρ is a weighting value associated with satisfaction of the outputconstraints 352. ε is a variable that the cost module 332 may set basedon whether the output constraints 352 will be satisfied. For example,the cost module 332 may increase E when a predicted parameter is greaterthan or less than the corresponding minimum or maximum value (e.g., byat least a predetermined amount). The cost module 332 may set ε to zerowhen all of the output constraints 352 are satisfied. ρ may be greaterthan the weighting value wT, the weighting value wTR, and the otherweighting values (wTV, wWG, wEGR, wIP, wEP) such that the costdetermined for a possible sequence will be large if one or more of theoutput constraints 352 are not satisfied. This may help preventselection of a possible sequence where one or more of the outputconstraints 352 are not satisfied.

The weighting value wT may be greater than the weighting value wTR andthe weighting values wTV, wWG, wEGR, wIP, and wEP. In this manner, therelationship between the relationship between the predicted enginetorque and the base air torque request 306 have a larger effect on thecost and, therefore, the selection of one of the possible sequences asdiscussed further below. The cost increases as the difference betweenthe predicted engine torque and the base air torque request 306increases and vice versa.

The weighting value wTR may be less than the weighting value wT andgreater than the weighting values wTV, wWG, wEGR, wIP, and wEP. In thismanner, the relationship between the ratio of the predicted torque tothe predicted APC and the constant K has a large effect on the cost, butless than the relationship between the predicted engine torque and thebase air torque request 306. The cost increases as the differencebetween the ratio of the predicted torque to the predicted APC and theconstant K increases and vice versa. The constant K may be adjusted to alarge value (e.g., 0.0) such that the cost typically decreases as theratio of the predicted torque to the predicted APC increases. In variousimplementations, a ratio of the predicted torque to a predicted fuelconsumption of the engine 102 may be used in place of the ratio of thepredicted torque to the predicted APC.

Determining the cost based on the ratio of the predicted torque to thepredicted APC therefore helps ensure that the ratio of the torque outputto the APC is maximized. Maximizing the ratio of the torque output tothe APC decreases fuel consumption as fueling is controlled based on theactual APC to achieve a target air/fuel mixture. As the selection module344 may select the one of the possible sequences having the lowest cost,the selection module 344 may select the one of the possible sequencesthat best achieves the base air torque request 306 while minimizing thefuel consumption.

The weighting values wTV, wWG, wEGR, wIP, and wEP may be less than allof the other weighting values. In this manner, during steady-stateoperation, the target values 266-270 may settle near or at the referencevalues 356, respectively. During transient operation, however, the MPCmodule 312 may adjust the target values 266-270 away from the referencevalues 356 in order to achieve the base air torque request 306, whileminimizing the fuel consumption and satisfying the actuator constraints348 and the output constraints 352.

In operation, the MPC module 312 may determine the cost values for thepossible sequences. The MPC module 312 may then select the one of thepossible sequences having the lowest cost. The MPC module 312 may nextdetermine whether the selected sequence satisfies the actuatorconstraints 348. If so, the selected sequence may be used. If not, theMPC module 312 determines, based on the selected sequence, a possiblesequence that satisfies the actuator constraints 348 and that has thelowest cost. The MPC module 312 may use the possible sequence thatsatisfies the actuator constraints 348 and that has the lowest cost.

A maximum torque module 366 estimates a maximum torque output 368 of theengine 102 when the engine 102 is operating at the reduced capacity. Asdiscussed above, the engine 102 may operate at the reduced capacity whenhalf of the cylinders of the engine 102 are deactivated or when theamount by which the intake and exhaust valves 122, 130 are lifted isadjusted to low lift. The maximum torque module 366 may estimate themaximum torque output 368 based on barometric pressure, an engine speed370, the intake air temperature, and/or knock intensity.

The engine speed 370 may be determined based on the crankshaft positionmeasured using the crankshaft position sensor 180. The intake airtemperature may be received from the IAT sensor 192. The barometricpressure and the knock intensity may be received from the other sensors193.

The maximum torque module 366 may estimate the maximum torque output 368based on a maximum APC and the MBT spark timing using a predeterminedrelationship between APC, spark timing, and torque output. Thepredetermined relationship may be embodied in a lookup table and may benonlinear. The maximum torque module 366 may determine the maximum APCbased on the pressure within the intake manifold 110, the engine speed370, and the intake air temperature. The maximum torque module 366 maydetermine the manifold pressure based on the barometric pressure orreceive the manifold pressure from the MAP sensor 184.

The maximum torque module 366 may limit the maximum torque output 368based on the amount of noise and vibration generated by the engine 102.The maximum torque module 366 may determine the current engine vibrationbased on the knock intensity. The maximum torque module 366 may estimatean expected engine vibration at a possible torque capacity that isdifferent than the current torque capacity. The maximum torque module366 may limit the maximum torque output 368 based on the current enginevibration and/or the expected engine vibration.

In various implementations, instead of the capacity control module 236determining the target torque capacity 287, a desired capacity module372 may determine the target torque capacity 287. The desired capacitymodule 372 may determine the target torque capacity 287 based on thebase air torque request 306 and the maximum torque output 368. Thedesired capacity module 372 may determine a first torque threshold and asecond torque threshold based on the maximum torque output 368. Thedesired capacity module 372 may switch the target torque capacity 287from full capacity to the reduced capacity when the base air torquerequest 306 is less than the first torque threshold. The first torquethreshold may be less than or equal to the maximum torque output 368.The desired capacity module 372 may switch the target torque capacity287 from the reduced capacity to full capacity when the base air torquerequest 306 is greater than the second torque threshold. The secondtorque threshold may be greater than the first torque threshold tominimize switching between full capacity and the reduced capacity.

Additionally or alternatively, the desired capacity module 372 may applya switching frequency limit. For example, when the number of torquecapacity switches is equal to a predetermined number (e.g., 3) within apredetermined period (e.g., 3 minutes), the desired capacity module 372may keep the target torque capacity 287 set to full torque capacity fora predetermined period.

The desired capacity module 372 may also determine a desired torquecapacity 374 of the engine 102 at a future time. For example, beforeswitching the target torque capacity 287 from full capacity to thereduced capacity, the desired capacity module 372 may switch the desiredtorque capacity 374 from full capacity to the reduced capacity.Similarly, before switching the target torque capacity 287 from thereduced capacity to full capacity, the desired capacity module 372 mayswitch the desired torque capacity 374 from the reduced capacity to fullcapacity.

When the torque capacity of the engine 102 is switched from fullcapacity to the reduced capacity, the APC required to achieve a giventorque output increases by nearly double since the displacement of theengine 102 decreases by half. The APC does not quite double due to anefficiency improvement. Thus, the total amount of intake airflowrequired to achieve the torque output decreases slightly. Since therequired amount of intake airflow decreases only slightly while the APCincreases by nearly double, the pressure in the intake manifold 110required to achieve the torque output increases. However, due to theamount of time required to increase the manifold pressure, the torqueoutput of the engine 102 may decrease when the torque capacity of theengine 102 is initially switched from full capacity to the reducedcapacity.

To avoid the time lag associated with increasing the manifold pressure,the anticipated torque request module 308 may determine the anticipatedtorque trajectory based on the desired torque capacity 374. When thedesired torque capacity 374 decreases, the anticipated torque requestmodule 308 may adjust the anticipated torque trajectory to reflect ananticipated torque increase. In turn, the MPC module 312 may adjust thetarget values 266-270 to satisfy the current base air torque request 306and to satisfy the anticipated torque increase with minimal lag. Forexample, the MPC module 312 may increase the target throttle openingarea 267 to increase the manifold pressure in response to theanticipated torque increase. In addition, the MPC module 312 may adjustthe target intake and exhaust cam phaser angles 269 and 270 to decreasethe volumetric efficiency of the engine 102 and thereby avoidovershooting the base air torque request 306. Then, when the torquecapacity of the engine 102 is actually switched from full capacity tothe reduced capacity, the MPC module 312 may adjust the target intakeand exhaust cam phaser angles 269 and 270 to quickly achieve the desiredtorque output. The amount of torque that the engine 102 can produce onshort notice by adjusting the target intake and exhaust cam phaserangles 269 and 270 may be referred to as an airflow reserve.

The volumetric efficiency of the engine 102 is a ratio (or percentage)of the actual quantity of air that enters cylinders of the engine 102during induction to the potential (or geometric) capacity of thecylinders under static conditions. The MPC module 312 may decrease thevolumetric efficiency of the engine 102 by adjusting the target intakeand exhaust cam phaser angles 269 and 270 to create internal dilution orto decrease the effective displacement of the engine 102. The effectivedisplacement of the engine 102 is the volume of air drawn into cylindersof the engine 102 as pistons in the cylinders travel from TDC to BDC,minus losses in air volume due to, for example, air flowing back throughthe intake valve 122. The MPC module 312 may determine whether todecrease the volumetric efficiency of the engine 102 by creatinginternal dilution or decreasing the effective displacement of the engine102 by selecting the option that yields the lowest cost.

The MPC module 312 may create internal dilution by advancing the targetintake cam phaser angle 269 and retarding the exhaust cam phaser angle270 to draw exhaust gas into the intake manifold 110. This reduces theamount of air and unburned fuel present in the cylinders, which reducesthe volumetric efficiency of the engine 102. The MPC module 312 mayreduce the effective displacement of the engine 102 by retarding thetarget intake cam phaser angle 269 to force air from the cylinders backinto the intake manifold 110 during the respective compression strokesof the cylinders.

The MPC module 312 may adjust the target values 266-270 in ways otherthan those described above to satisfy the current base air torquerequest 306 and to satisfy the anticipated torque increase with minimallag. For example, the MPC module 312 may decrease the target wastegateopening area 266 to increase the manifold pressure in response to theanticipated torque increase. In addition, the MPC module 312 maydecrease the target throttle opening area 267 avoid overshooting thebase air torque request 306 as the target wastegate opening area 266 isdecreased. Then, when the torque capacity of the engine 102 is actuallyswitched from full capacity to the reduced capacity, the MPC module 312may adjust the target intake and exhaust cam phaser angles 269 and 270to quickly achieve the desired torque output. The MPC module 312 maydetermine how to adjust the target values 266-270 to satisfy both thecurrent base air torque request 306 and the anticipated torque increaseby selecting the one of the possible sequences of the target values266-270 that yields the lowest cost.

When the torque capacity of the engine 102 is switched from the reducedcapacity to full capacity, the pressure in the intake manifold 110required to achieve the torque output decreases. To avoid the time lagassociated with decreasing the manifold pressure using the throttlevalve 112, the anticipated torque request module 308 may determine theanticipated torque trajectory based on the desired torque capacity 374.When the desired torque capacity 374 decreases, the anticipated torquerequest module 308 may adjust the anticipated torque trajectory toreflect an anticipated torque decrease. In turn, the MPC module 312 mayadjust the target values 266-270 to satisfy the base air torque request306 and to satisfy the anticipated torque decrease with minimal lag. Forexample, the MPC module 312 may decrease the target throttle openingarea 267 in response to the anticipated torque increase and adjust thetarget intake and exhaust cam phaser angles 269 and 270 to satisfy thebase air torque request 306. Then, when the torque capacity of theengine 102 actually switches from the reduced capacity to full capacity,the MPC module 312 may adjust the target intake and exhaust cam phaserangles 269 and 270 to quickly achieve the desired torque output.

The MPC module 312 may adjust the target intake and exhaust cam phaserangles 269 and 270 to increase the volumetric efficiency of the engine102 and thereby satisfy the base air torque request 306 as the targetthrottle opening area 267 is decreased. The MPC module 312 may increasethe volumetric efficiency of the engine 102 by adjusting the targetintake and exhaust cam phaser angles 269 and 270 to decrease internaldilution or to increase the effective displacement of the engine 102.The MPC module 312 may determine whether to increase the volumetricefficiency of the engine 102 by decreasing internal dilution orincreasing the effective displacement of the engine 102 by selecting theoption that yields the lowest cost.

The MPC module 312 may decrease internal dilution by retarding thetarget intake cam phaser angle 269 and advancing the exhaust cam phaserangle 270 to decrease the amount of exhaust gas drawn into the intakemanifold 110. This increases the amount of air and unburned fuel presentin the cylinders, which increases the volumetric efficiency of theengine 102. The MPC module 312 may increase the effective displacementof the engine 102 by advancing the target intake cam phaser angle 269 toavoid forcing air from the cylinders to the intake manifold 110 duringtheir respective compression strokes.

The desired capacity module 372 may also determine a model torquecapacity 376. As discussed above, the model 324 may include a pluralityof linear models that each correspond to an engine speed and load range.In addition, for each engine speed and engine load range, the model 324may include a full capacity model for full capacity and a reducedcapacity model for the reduced capacity. The prediction module 323 mayuse the model torque capacity 376 to determine whether to use the fullcapacity model or the reduced capacity model when predicting theresponses of the engine 102. In addition, the reference module 364 (FIG.2) may determine the reference values 356 based on the model torquecapacity 376.

The relationship between the torque output of the engine 102, the APC,and the target values 266-270 changes as the torque capacity of theengine 102 is switched between full capacity and the reduced capacity.For example, the APC may be set to 200 milligrams (mg) to achieve acertain torque output when all cylinders are active, while the APC maybe set to 380 mg to achieve the same torque output when half of thecylinders are active. Thus, the amount of APC required to achieve acertain torque output may be nearly doubled when half of the cylindersare deactivated, but not be quite doubled due to an efficiencyimprovement. The throttle position required to achieve a given torqueoutput also changes when half of the cylinders are deactivated sinceslightly less intake airflow is required. Further, since the amount ofintake airflow decreases only slightly while the number of cylindersdecreases by half, the manifold pressure increases. Thus, therelationship between the throttle position and the manifold pressurechanges. The prediction module 323 accounts for these changingrelationships by selecting the appropriate torque capacity model.

The desired capacity module 372 may switch the model torque capacity 376after adjusting the desired torque capacity 374 and before or afterswitching the target torque capacity 287. In one example, the desiredcapacity module 372 may switch the desired torque capacity 374 P controlloops before switching the target torque capacity 287. The desiredcapacity module 372 may then switch the model torque capacity 376 Qcontrol loops before switching the target torque capacity 287, where Qis less than P.

The anticipated torque request module 308 may determine the anticipatedtorque trajectory with a prediction period of 500 milliseconds (ms) via20 control loops. In other words, the period of each of the N controlloops may be 25 milliseconds, and N may be equal to 20. In addition, thedesired capacity module 372 may switch the desired torque capacity 374at a time corresponding to 10 control loops or 250 ms before the desiredtorque capacity 374 switches the target torque capacity 287. Thus, inthe example above, P may be equal to 10. The value of P may bepredetermined to ensure that the MPC module 312 has enough time toadjust engine operation by switching the target values 266-270 tosatisfy the base air torque request 306 and satisfy the anticipatedtorque increase with minimal lag. For example, there may be a lag ordelay from the time when the MPC module 312 adjust the target wastegateopening area 266 to zero and the time when the manifold pressure (orboost) increases in response to the wastegate 162 closing. Switching themodel torque capacity 376 before the manifold pressure increases maycause a torque hole. Thus, the desired torque capacity 374 may beswitched a number of control loops before the model torque capacity 376is switched to allow enough time for an airflow reserve to be createdafter the anticipated torque trajectory is adjusted to reflect ananticipated torque increase.

When the desired capacity module 372 switches the model torque capacity376 from full capacity to the reduced capacity, the torque output of theengine 102 may increase due to an increase in a desired APC. The torqueoutput of the engine 102 may then decrease when the torque capacity ofthe engine 102 actually switches from full capacity to the reducedcapacity. Thus, the driver may initially feel a torque surge when themodel torque capacity 376 is switched, followed by a torque hole whenthe torque capacity of the engine 102 actually switches from fullcapacity to reduced capacity. To avoid this undesired driver feel, theECM 114 may instruct the transmission control module 194 to createtorque converter slip during a switch.

The desired capacity module 372 may switch the model torque capacity 376at a time corresponding to 1 control loop or 25 ms before the desiredtorque capacity 374 switches the target torque capacity 287. Thus, inthe example above, Q may be equal to 1. The value of Q may bepredetermined such that the period of the torque increase before theswitch and the period of the torque decrease after the switch are equal.In turn, less torque converter slip may be used to improve driver feelduring the switch.

There may be a delay from the time when the desired capacity module 372switches the target torque capacity 287 to the time when the capacitycontrol module 120 actually switches the torque capacity of the engine102. For example, the intake and exhaust cam phasers 148 and 150 may becoupled to the intake and exhaust camshafts 140, 142 using pins (notshown), and the capacity control module 120 may not remove the pins todeactivate the cylinder 118 until there is no force on the pins. Theremay be no force on the pin when the intake and exhaust cam phasers 148and 150 are not lifting the intake and exhaust valves 122 and 130, suchas during a power stroke or a compression stroke. Thus, when the desiredcapacity module 372 switches the target torque capacity 287, thecapacity control module 120 may not deactivate a cylinder of the engine102 until a piston in the cylinder is completing a power stroke or acompression stroke. Therefore, during the period from the time whendesired capacity module 372 switches the target torque capacity 287 tothe time when the capacity control module 120 actually switches thetorque capacity of the engine 102, the engine 102 may complete twoengine cycles. Each engine cycle may correspond to two crankshaftrevolutions.

The period of one engine cycle may be determined using a relationshipsuch as

Tec=120000/RPM,  (3)

where Tec is the period of one engine cycle in ms and RPM is the enginespeed in revolutions per minute. Thus, for example, if the engine speedis 1200 RPM, the period of each engine cycle may be 100 ms.

When determining when to switch the desired torque capacity 374 and/orwhen to switch the model torque capacity 376, the desired capacitymodule 372 may account for the lag from the time when the target torquecapacity 287 is switched to the time when the actual torque capacity ofthe engine 102 is switched. Thus, if the period of two engine cycles is200 ms and the period required to increase the manifold pressure inresponse to the anticipated torque increase is 300 ms, the desiredcapacity module 372 may switch the desired torque capacity 374 100 msbefore switching the target torque capacity 287.

Referring now to FIGS. 2 and 4, in various implementations, the base airtorque requests 310 may be sent to a setpoint module 402 instead of theMPC module 312. The setpoint module 402 generates setpoint values forcontrolling the throttle valve 112, the EGR valve 170, the wastegate162, the intake cam phaser 148, and the exhaust cam phaser 150 toachieve the base air torque request 306 at the present engine speed 370.The setpoints may be referred to as engine air and exhaust setpoints. Invarious implementations, the torque conversion module 304 may convertthe air torque request 265 into another type of torque that is suitablefor use by the setpoint module 402, such as an indicated torque. Anindicated torque may refer to a torque at the crankshaft attributable towork produced via combustion within the cylinders.

For example, the setpoint module 402 may generate a throttle inlet airpressure (TIAP) setpoint 406, a mass of air per cylinder (APC) setpoint408, an external dilution setpoint 410, a residual dilution setpoint412, and an effective displacement setpoint 414. The setpoint module 402may generate the TIAP setpoint 406, the APC setpoint 408, the externaldilution setpoint 410, the residual dilution setpoint 412, and theeffective displacement setpoint 414 using one or more functions ormappings that relate the base air torque request 306 and the enginespeed 370 to the setpoints. The setpoint module 402 may also generatefuture setpoints for the N control loops. Thus, each of the setpoints406-414 may include future setpoints for the N control loops. Asdiscussed above, the based air torque requests 310 may include the baseair torque requests 306 and anticipated based air torque requests. Thesetpoint module 402 may generate the future setpoints using one or morefunctions or mappings that relate the anticipated torque requests andthe engine speed 370 to the future setpoints.

The TIAP setpoint 406 may refer to a target pressure downstream from thecompressor 160-2 and upstream from the throttle valve 112. The APCsetpoint 408 may refer to a target mass of air to be drawn into acylinder for a combustion event. The external dilution setpoint 410 mayrefer to a target amount of external dilution. The residual dilutionsetpoint 412 may refer to a target amount of residual dilution. Theeffective displacement setpoint 414 may refer to a target volume of airdrawn into cylinders of the engine 102 as pistons in the cylinderstravel from TDC to BDC minus losses in air volume due to, for example,air flowing back through the intake valve 122.

The setpoint module 402 may generate one or more of the setpoints406-414 further based on desired combustion phasing 416 and the modeltorque capacity 376. When one or more cylinders are deactivated, eachactive cylinder is responsible for producing a greater amount of torquein order to achieve the base air torque request 306. The setpoint module402 may therefore adjust one or more of the setpoints 406-414 based onthe model torque capacity 376. For example, the setpoint module 402 mayincrease the APC setpoint 408 when the model torque capacity 376 isswitched from full capacity to the reduced capacity.

A combustion phasing module 418 (FIG. 2) may generally set the desiredcombustion phasing 416 such that the CA50 occurs at the predeterminedCA50. In other words, the combustion phasing module 418 may generallyset the desired combustion phasing 416 such that zero combustion phasingoccurs to achieve the maximum work and therefore a maximum fuelefficiency. However, the combustion phasing module 418 may selectivelyadjust the desired combustion phasing 416 under some circumstances.

For example, the combustion phasing module 418 may set the desiredcombustion phasing such that the CA50 occurs after the predeterminedCA50 when knock is detected. Knock may be detected, for example, usingone or more knock sensors. Additionally or alternatively, the combustionphasing module 418 may set the desired combustion phasing such that theCA50 occurs after the predetermined CA50 when one or more conditions arepresent that may cause knock to occur. For example, knock may occur whena quality of fuel within a fuel tank of the vehicle is less than apredetermined quality and/or the ambient temperature is greater than apredetermined temperature and ambient humidity is less than apredetermined value.

When combustion is retarded such that the CA50 occurs after thepredetermined CA50, airflow into the cylinders should be increased toachieve the base air torque request 306. The setpoint module 402 maytherefore adjust one or more of the setpoints 406-414 based on thedesired combustion phasing 416. For example, the setpoint module 402 mayincrease the APC setpoint 408 when the desired combustion phasing 416 isretarded to provide a CA50 that is after the predetermined CA50.

The setpoint module 402 also generates the setpoints 406-414 based onone or more setpoint constraints 420. A setpoint constraint module 422may set the setpoint constraints 420 for the setpoints 406-414 topredetermined acceptable ranges, respectively. The setpoint module 402sets the setpoints 406-414 to remain within the setpoint constraints420, respectively.

However, the setpoint constraint module 422 may selectively adjust asetpoint constraint under some circumstances. For example only, thesetpoint constraint module 422 may set a setpoint constraint to disabledilution. The setpoint module 402 may limit the external dilutionsetpoint 410 and the residual dilution setpoint 412 to zero in responsethe setpoint constraint to disable dilution.

The setpoint module 402 may also adjust one or more of the othersetpoints based on the limitation of a setpoint. For example, thesetpoint module 402 may increase the APC setpoint 408 in order toachieve the base air torque request 306 when the external and residualdilution setpoints 410 and 412 are limited.

The MPC module 312 determines a cost (value) for each of the possiblesequences of the target values 266-270 based on relationships betweenthe setpoints 406-414 and the predictions, respectively. For example,the MPC module 312 may determine the cost for each of the possiblesequences of the target values 266-270 based on the periods for thepredicted parameters to reach the setpoints 406-414, respectively,and/or amounts that the predicted parameters overshoot the setpoints406-414, respectively. For example only, the cost may increase as theperiod for a predicted parameter to reach a setpoint increases and/or asthe amount that the predicted parameter overshoots the setpointincreases. In various implementations, satisfaction of the actuatorconstraints 348 and the setpoint constraints 420 may be considered inthe cost determination. In other words, the cost module 332 maydetermine the cost values further based on the actuator constraints 348and the setpoint constraints 420.

Each pair of predicted parameters and setpoints may be weighted toaffect how much the relationships between the predicted parameters andthe setpoints affects the cost. For example, the relationship betweenthe predicted APC and the APC setpoint 408 maybe weighted to affect thecost more than the relationship between another predicted parameter andthe corresponding setpoint.

In FIG. 3, the MPC module 312 adjusts the target values 266-270 tosatisfy the base air torque requests 310, which include the current baseair torque request 306 and the anticipated torque requests. Thus, whenthe anticipated torque trajectory indicates an anticipated torqueincrease, the MPC module 312 may adjust the target throttle opening area267 in response to the anticipated torque increase. In addition, the MPCmodule 312 may adjust the target intake and exhaust cam phaser angles269 and 270 to avoid overshooting the base air torque request 306 whenthe target throttle area opening 267 is increased. For example, the MPCmodule 312 may adjust the target intake and exhaust cam phaser angles269 and 270 to decrease the volumetric efficiency of the engine 102 bycreating internal dilution or decreasing the effective displacement ofthe engine 102.

In contrast, in FIG. 4, the setpoint module 402 adjusts the setpoints406-414 based on the base air torque requests 310, and the MPC module312 adjusts the target values 266-270 based on the setpoints 406-414.Thus, when the anticipated torque trajectory indicates an anticipatedtorque increase, the setpoint module 402 may adjust one or more of thesetpoints 406-414 to decrease the volumetric efficiency of the engine102 and thereby create an airflow reserve. For example, the setpointmodule 402 may decrease the volumetric efficiency of the engine 102 byincreasing the residual dilution setpoint 412 or decreasing theeffective displacement setpoint 414. To satisfy the base air torquerequest 306 as the volumetric efficiency of the engine 102 is decreased,the MPC module 312 may increase the target throttle opening area 267and/or increase the manifold pressure. As the airflow reserve iscreated, the setpoint module 402 may not change the APC setpoint 402 ormay slightly decrease the APC setpoint 402. Then, when a torque increaseis actually needed, the setpoint module 402 may increase the APCsetpoint 402 and increase the volumetric efficiency of the engine 102.The setpoint module 402 may increase the volumetric efficiency of theengine 102 by decreasing the residual dilution setpoint 412 orincreasing the effective displacement setpoint 414.

In FIG. 3, when the anticipated torque trajectory indicates ananticipated torque decrease, the MPC module 312 may increase thevolumetric efficiency of the engine 102 by adjusting the target intakeand exhaust cam phaser angles 269 and 270. In addition, the MPC module312 may decrease the target throttle opening area 267 to avoidovershooting the base air torque request 306 as the volumetricefficiency of the engine 102 is increased. Then, when a torque decreaseis actually needed, the MPC module 312 may decrease the volumetricefficiency of the engine 102 by adjusting the target intake and exhaustcam phaser angles 269 and 270.

In contrast, in FIG. 4, when the anticipated torque trajectory indicatesan anticipated torque decrease, the setpoint module 402 may increase thevolumetric efficiency of the engine 102 by decreasing the residualdilution setpoint 412 or increasing the effective displacement setpoint414. In addition, to avoid overshooting the APC setpoint 408 as thevolumetric efficiency of the engine 102 is increased, the MPC module 312may decrease the target throttle area opening 267. Then, when a torquedecrease is actually needed, the setpoint module 402 may decrease thevolumetric efficiency of the engine 102 by increasing the residualdilution setpoint 412 or decreasing the effective displacement setpoint414.

Referring now to FIG. 5, a flowchart depicting an example method ofcontrolling the throttle valve 112, the intake cam phaser 148, theexhaust cam phaser 150, the wastegate 162 (and therefore theturbocharger), and the EGR valve 170 using MPC (model predictivecontrol) begins at 502. At 504, the torque requesting module 224determines the air torque request 265 based on the adjusted predictedand immediate torque requests 263 and 264. At 506, the torque conversionmodule 304 converts the air torque request 265 into the base air torquerequest 306 or into another suitable type of torque for use by the MPCmodule 312 or the setpoint module 402.

At 508, the maximum torque module determines the maximum torque outputof the engine 102 at the reduced capacity. At 510, the desired capacitymodule 372 determines the target torque capacity 287, the desired torquecapacity 374, and the model torque capacity 376. In variousimplementations, at 511, the reference module 364 determines thereference values 356 based on the base air torque request and the modeltorque capacity 376. At 512, the anticipated torque request module 308determines the anticipated torque requests based on the desired torquecapacity 374. In various implementations, at 514, the setpoint module402 generates the setpoints 406-414 based on the base air torque requestand the anticipated torque requests.

At 516, the sequence determination module 316 determines possiblesequences of the target values 266-270 based on the base air torquerequest 306. At 518, the prediction module 323 determines the predictedparameters for each of the possible sequences of target values. Theprediction module 323 determines the predicted parameters for thepossible sequences based on the model 324 of the engine 102, theexogenous inputs 328, and the feedback inputs 330. More specifically,based on a possible sequence of the target values 266-270, the exogenousinputs 328, and the feedback inputs 330, using the model 324, theprediction module 323 generates a sequence of predicted torques of theengine 102 for the N control loops, a sequence of predicted APCs for theN control loops, a sequence of predicted amounts of external dilutionfor the N control loops, a sequence of predicted amounts of residualdilution for the N control loops, a sequence of predicted combustionphasing values for the N control loops, and a sequence of predictedcombustion quality values for the N control loops.

At 520, the cost module 332 determines the costs for the possiblesequences, respectively. For example only, the cost module 332 maydetermine the cost for a possible sequence of the target values 266-270based on the equation

${{Cost} = {{\sum\limits_{i = 1}^{N}\; {{{wT}*\left( {{TP}_{i} - {BATR}_{i}} \right)}}^{2}} + {{{wTR}\frac{T}{FC}*\left( {\frac{{TP}_{i}}{{FAPC}_{i}} - K} \right)}}^{2}}},$

or based on the equation

${{Cost} = {{\sum\limits_{i = 1}^{N}\; {\rho\varepsilon}^{2}} + {{{wT}*\left( {{TP}_{i} - {BATR}_{i}} \right)}}^{2} + {{{wTR}\frac{T}{FC}*\left( {\frac{{TP}_{i}}{{FAPC}_{i}} - K} \right)}}^{2} + {{wTV}*\left( {{PTTOi} - {TORef}} \right)^{2}} + {{{wWG}*\left( {{PTWGOi} - {EGORef}} \right)}}^{2} + {{{wEGR}*\left( {{PTEGROi} - {EGRORef}} \right)}}^{2} + {{{wIP}*\left( {{PTICPi} - {ICPRef}} \right)}}^{2} + {{{wEP}*\left( {{PTECPi} - {ECPRef}} \right)}}^{2}}},$

subject to the actuator constraints 348 and the output constraints 352,as discussed above.

At 522, the selection module 344 selects one of the possible sequencesof the target values 266-270 based on the costs of the possiblesequences, respectively. For example, the selection module 344 mayselect the one of the possible sequences having the lowest cost whilesatisfying the actuator constraints 348 and the output constraints 352.The selection module 344 may therefore select the one of the possiblesequences that best achieves the base air torque request 306 whileminimizing the APC and satisfying the output constraints 352. Instead ofor in addition to determining possible sequences of the target values230-244 at 516 and determining the cost of each of the sequences at 520,the MPC module 312 may identify a sequence of possible target valueshaving the lowest cost using convex optimization techniques as discussedabove.

At 524, the MPC module 312 may determine whether the selected one of thepossible sequences satisfies the actuator constraints 348. If theselected sequence does not satisfy the actuator constraints 348, themethod continues at 526. Otherwise, the method continues at 528. At 526,the MPC module 312 determines, based on the selected sequence, apossible sequence that satisfies the actuator constraints 348 and thathas the lowest cost. The method then continues at 528.

At 528, the first conversion module 272 converts the target wastegateopening area 266 into the target duty cycle 274 to be applied to thewastegate 162, the second conversion module 276 converts the targetthrottle opening area 267 into the target duty cycle 278 to be appliedto the throttle valve 112. The third conversion module 280 also convertsthe target EGR opening area 268 into the target duty cycle 282 to beapplied to the EGR valve 170 at 428. The fourth conversion module mayalso convert the target intake and exhaust cam phaser angles 269 and 270into the target intake and exhaust duty cycles to be applied to theintake and exhaust cam phasers 148 and 150, respectively.

At 530, the throttle actuator module 116 controls the throttle valve 112to achieve the target throttle opening area 267, and the phaser actuatormodule 158 controls the intake and exhaust cam phasers 148 and 150 toachieve the target intake and exhaust cam phaser angles 269 and 270,respectively. For example, the throttle actuator module 116 may apply asignal to the throttle valve 112 at the target duty cycle 278 to achievethe target throttle opening area 267. Also at 530, the EGR actuatormodule 172 controls the EGR valve 170 to achieve the target EGR openingarea 268, and the boost actuator module 164 controls the wastegate 162to achieve the target wastegate opening area 266. For example, the EGRactuator module 172 may apply a signal to the EGR valve 170 at thetarget duty cycle 282 to achieve the target EGR opening area 268, andthe boost actuator module 164 may apply a signal to the wastegate 162 atthe target duty cycle 274 to achieve the target wastegate opening area266. The method may then return to 504. In this regard, FIG. 5 may beillustrative of one control loop, and control loops may be executed at apredetermined rate.

Referring now to FIG. 6, a graph illustrates actual and desiredoperating conditions of the engine 102 as the torque capacity of theengine 102 is switched from full capacity to a reduced capacity usingMPC (model predictive control). The operating conditions include thedesired torque capacity 374, an actual torque capacity 602 of the engine102, the model torque capacity 376, an anticipated torque trajectory604, the target throttle opening area 267, a volumetric efficiency 606of the engine 102, a pressure 608 within the intake manifold 110, and atorque output 610 of the engine 102. The operating conditions areplotted with respect to an x-axis 612 that represents time.

At 614, the desired capacity module 372 switches the desired torquecapacity 374 from full capacity to the reduced capacity. In response,the anticipated torque request module 308 adjusts the anticipated torquetrajectory 604 to reflect an anticipated torque increase. In addition,the MPC module 312 increases the target throttle opening area 267 basedon the anticipated torque increase. In turn, the manifold pressure 608starts to increase. Further, the MPC module 312 decreases the volumetricefficiency 606 by adjusting the target intake and exhaust cam phaserpositions 269, 270 such that the engine torque output 610 is notaffected by the increase in the target throttle opening area 267.

At 616, the desired capacity module 372 switches the model torquecapacity 376 from full capacity to the reduced capacity. In response,the MPC module 312 adjusts the target intake and exhaust cam phaserpositions 269, 270 to increase the volumetric efficiency 606 and therebyincrease the air per cylinder (APC) of the engine. In addition, the MPCmodule 312 initially increases the target throttle opening area 267, andthen decreases the target throttle opening area 267 as the volumetricefficiency 606 increases. However, despite the decrease in the targetthrottle opening area 267, the engine torque output 610 increases due tothe increase in the volumetric efficiency 606.

At 618, the cylinder actuator module 120 switches the actual torquecapacity 602 from full capacity to the reduced capacity. In turn, theengine torque output 610 initially decreases and then increases as thevolumetric efficiency 606 continues to increase. The desired capacitymodule 372 may switch the model torque capacity 376 at a time thatcauses the period of the increase in the engine torque output 610 before618 to be equal to the period of the increase in the engine torqueoutput 610 after 618.

Referring now to FIG. 7, a graph illustrates actual and desiredoperating conditions of the engine 102 as the torque capacity of theengine 102 is switched from a reduced capacity to a full capacity usingMPC (model predictive control). The operating conditions include thedesired torque capacity 374, an actual torque capacity 702 of the engine102, the model torque capacity 376, an anticipated torque trajectory704, the target throttle opening area 267, a volumetric efficiency 706of the engine 102, a pressure 708 within the intake manifold 110, atorque output 710 of the engine 102 based on air actuator values, and anactual torque output 712 of the engine 102. The operating conditions areplotted with respect to an x-axis 714 that represents time.

At 716, the desired capacity module 372 switches the desired torquecapacity 374 from the reduced capacity to full capacity. In response,the anticipated torque request module 308 adjusts the anticipated torquetrajectory 704 to reflect an anticipated torque decrease. In addition,the MPC module 312 decreases the target throttle opening area 267 andgradually increases the volumetric efficiency 706 by adjusting thetarget intake and exhaust cam phaser positions 269, 270. In turn, themanifold pressure 708 starts to decrease.

At 718, the desired capacity module 372 switches the model torquecapacity 376 from the reduced capacity to full capacity. In response,the MPC module 312 initially decreases the target throttle opening area267, and then increases the target throttle opening area 267 as thevolumetric efficiency 706 continues to increase.

At 720, the cylinder actuator module 120 switches the actual torquecapacity 702 from the reduced capacity to full capacity. In turn, theengine torque output 710 based on the air actuator values increasessince the air actuators have not yet been adjusted to decrease theamount of airflow provided to each cylinder of the engine 102. However,an increase in the actual torque output 712 may be prevented by, forexample, retarding the target spark timing 286.

The foregoing description is merely illustrative in nature and is in noway intended to limit the disclosure, its application, or uses. Thebroad teachings of the disclosure can be implemented in a variety offorms. Therefore, while this disclosure includes particular examples,the true scope of the disclosure should not be so limited since othermodifications will become apparent upon a study of the drawings, thespecification, and the following claims. As used herein, the phrase atleast one of A, B, and C should be construed to mean a logical (A or Bor C), using a non-exclusive logical OR. It should be understood thatone or more steps within a method may be executed in different order (orconcurrently) without altering the principles of the present disclosure.

In this application, including the definitions below, the term modulemay be replaced with the term circuit. The term module may refer to, bepart of, or include an Application Specific Integrated Circuit (ASIC); adigital, analog, or mixed analog/digital discrete circuit; a digital,analog, or mixed analog/digital integrated circuit; a combinationallogic circuit; a field programmable gate array (FPGA); a processor(shared, dedicated, or group) that executes code; memory (shared,dedicated, or group) that stores code executed by a processor; othersuitable hardware components that provide the described functionality;or a combination of some or all of the above, such as in asystem-on-chip.

The term code, as used above, may include software, firmware, and/ormicrocode, and may refer to programs, routines, functions, classes,and/or objects. The term shared processor encompasses a single processorthat executes some or all code from multiple modules. The term groupprocessor encompasses a processor that, in combination with additionalprocessors, executes some or all code from one or more modules. The termshared memory encompasses a single memory that stores some or all codefrom multiple modules. The term group memory encompasses a memory that,in combination with additional memories, stores some or all code fromone or more modules. The term memory may be a subset of the termcomputer-readable medium. The term computer-readable medium does notencompass transitory electrical and electromagnetic signals propagatingthrough a medium, and may therefore be considered tangible andnon-transitory. Non-limiting examples of a non-transitory tangiblecomputer readable medium include nonvolatile memory, volatile memory,magnetic storage, and optical storage.

The apparatuses and methods described in this application may bepartially or fully implemented by one or more computer programs executedby one or more processors. The computer programs includeprocessor-executable instructions that are stored on at least onenon-transitory tangible computer readable medium. The computer programsmay also include and/or rely on stored data.

What is claimed is:
 1. A system comprising: a desired capacity modulethat generates a desired torque capacity of an engine at a future timebased on a present torque request and a maximum torque output of theengine; an anticipated torque request module that generates ananticipated torque request based on the desired torque capacity; and anengine actuator module that controls an actuator of the engine at apresent time based on the anticipated torque request.
 2. The system ofclaim 1 wherein the desired capacity module switches the desired torquecapacity to one of a first torque capacity and a second torque capacitybefore switching a target torque capacity of the engine at the presenttime to the one of the first torque capacity and the second torquecapacity.
 3. The system of claim 2 wherein the desired capacity module:determines a first torque threshold based on the maximum torque outputof the engine when the engine is operating at the second torquecapacity; and switches the target torque capacity from the first torquecapacity to the second torque capacity when the present torque requestis less than the first torque threshold.
 4. The system of claim 3wherein the desired capacity module: determines a second torquethreshold based on the maximum torque output of the engine when theengine is operating at the second torque capacity; and switches thetarget torque capacity from the second torque capacity to the firsttorque capacity when the present torque request is greater than thesecond torque threshold, wherein the second torque threshold is greaterthan the first torque threshold.
 5. The system of claim 4 furthercomprising: a prediction module that: generates a first predicted engineoutput torque based on a model of the engine and a first set of possibletarget values determined based on the present torque request and theanticipated torque request; and generates a second predicted engineoutput torque based on the model of the engine and a second set ofpossible target values determined based on the present torque requestand the anticipated torque request; a cost module that: determines afirst cost for the first set of possible target values based on a firstpredetermined weighting value, the first predicted engine output torque,the present torque request, and the anticipated torque request; anddetermines a second cost for the second set of possible target valuesbased on the first predetermined weighting value, the second predictedengine output torque, the present torque request, and the anticipatedtorque request; and a selection module that selects one of the first andsecond sets based on the first and second costs and that sets targetvalues based on the possible target values of the selected one of thefirst and second sets, wherein the engine actuator module controls theengine actuator based on a first one of the target values.
 6. The systemof claim 5 wherein the anticipated torque request includes a pluralityof anticipated torque requests.
 7. The system of claim 5 wherein theselection module selects the first set when the first cost is less thanthe second cost, and the selection module selects the second set whenthe second cost is less than the first cost.
 8. The system of claim 5wherein: the desired capacity module switches a model torque capacity tothe one of the first torque capacity and the second torque capacityafter switching the desired torque capacity to the one of the firsttorque capacity and the second torque capacity and before switching thetarget torque capacity to the one of the first torque capacity and thesecond torque capacity; and the prediction module selects the model ofthe engine from a plurality of models based on the model torquecapacity.
 9. The system of claim 8 further comprising a reference modulethat generates reference values based on the model torque capacity,wherein the cost module determines the first cost and the second costfurther based on the reference values.
 10. The system of claim 8 furthercomprising a setpoint module that generates air and exhaust setpointsfor the engine based on the present torque request, the anticipatedtorque request, and the model torque capacity, wherein the cost moduledetermines the first cost and the second cost based on the setpoints.11. A method comprising: generating a desired torque capacity of anengine at a future time based on a present torque request and a maximumtorque output of the engine; generating an anticipated torque requestbased on the desired torque capacity; and controlling an actuator of theengine at a present time based on the anticipated torque request. 12.The method of claim 11 further comprising switching the desired torquecapacity to one of a first torque capacity and a second torque capacitybefore switching a target torque capacity of the engine at the presenttime to the one of the first torque capacity and the second torquecapacity.
 13. The method of claim 12 further comprising: determining afirst torque threshold based on the maximum torque output of the enginewhen the engine is operating at the second torque capacity; andswitching the target torque capacity from the first torque capacity tothe second torque capacity when the present torque request is less thanthe first torque threshold.
 14. The method of claim 13 furthercomprising: determining a second torque threshold based on the maximumtorque output of the engine when the engine is operating at the secondtorque capacity; and switching the target torque capacity from thesecond torque capacity to the first torque capacity when the presenttorque request is greater than the second torque threshold, wherein thesecond torque threshold is greater than the first torque threshold. 15.The method of claim 14 further comprising: generating a first predictedengine output torque based on a model of the engine and a first set ofpossible target values determined based on the present torque requestand the anticipated torque request; generating a second predicted engineoutput torque based on the model of the engine and a second set ofpossible target values determined based on the present torque requestand the anticipated torque request; determining a first cost for thefirst set of possible target values based on a first predeterminedweighting value, the first predicted engine output torque, the presenttorque request, and the anticipated torque request; determining a secondcost for the second set of possible target values based on the firstpredetermined weighting value, the second predicted engine outputtorque, the present torque request, and the anticipated torque request;selecting one of the first and second sets based on the first and secondcosts and that sets target values based on the possible target values ofthe selected one of the first and second sets; and controlling theengine actuator based on a first one of the target values.
 16. Themethod of claim 15 wherein the anticipated torque request includes aplurality of anticipated torque requests.
 17. The method of claim 15further comprising: selecting the first set when the first cost is lessthan the second cost; and selecting the second set when the second costis less than the first cost.
 18. The method of claim 15 furthercomprising: switching a model torque capacity to the one of the firsttorque capacity and the second torque capacity after switching thedesired torque capacity to the one of the first torque capacity and thesecond torque capacity and before switching the target torque capacityto the one of the first torque capacity and the second torque capacity;and selecting the model of the engine from a plurality of models basedon the model torque capacity.
 19. The method of claim 18 furthercomprising: generating reference values based on the model torquecapacity; and determining the first cost and the second cost furtherbased on the reference values.
 20. The method of claim 18 furthercomprising: generating air and exhaust setpoints for the engine based onthe present torque request, the anticipated torque request, and themodel torque capacity; and determining the first cost and the secondcost based on the setpoints.